import { GCellRenderer } from "../../../../../com/mui/controls/GCellRenderer";
import { ItemData } from "../../../resource/info/ItemData";
import { ItemsUtil } from "../../shortcuts/item/ItemsUtil";
import { ObjCreate } from "../../common/ObjCreate";
import { BaseItem } from "../../common/BaseItem";
import { Language } from "../../../../../extend/language/Language";
type int = number;
//class QiCostCellRenderer
    
    export  class QiCostCellRenderer extends GCellRenderer
    {
        constructor()
        {
            super();
            this.init();
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            super.data = arg1;
            this._itemData = arg1["itemData"] as ItemData;
            this._num = arg1["num"] as int;
            if (this._itemData) 
            {
                this._baseItem.itemData = this._itemData;
                this._baseItem.amount = this._num;
                this._nameTxt.htmlText = ItemsUtil.getItemName(this._itemData);
                this._numTxt.x = this._nameTxt.x + this._nameTxt.width + 5;
                this._numTxt.text = "*" + this._num;
                this._valueTxt.text = (this._itemData.gasValue * this._num).toString();
            }
            return;
        }

        /* internal  */init(): void
        {
            ObjCreate.createBg(0, 0, 160, 40, this);
            this._baseItem = new BaseItem();
            this._baseItem.isDragAble = false;
            this._baseItem.isDropAble = false;
            this._baseItem.isShowLock = true;
            this._baseItem.setSize(32, 32);
            this._baseItem.move(5, 5);
            this.addChild(this._baseItem);
            this._nameTxt = ObjCreate.createTextField("", 44, 5, 220, 20, this);
            this._nameTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._numTxt = ObjCreate.createTextField("", 110, 5, 220, 20, this);
            this._numTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            ObjCreate.createTextField(Language.getString(35980), 44, 25, 220, 20, this);
            this._valueTxt = ObjCreate.createTextField("", 95, 25, 220, 20, this);
            this._valueTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            return;
        }

        /* internal */ /* var */_baseItem: BaseItem;

        /* internal */ /* var */_nameTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_numTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_valueTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_itemData: ItemData;

        /* internal */ /* var */_num: int;
    }
